<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <meta name="robots" content="index, follow, all" />
    <title>Search | PhpRedis API</title>

                <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
        <link rel="stylesheet" type="text/css" href="css/bootstrap-theme.min.css">
        <link rel="stylesheet" type="text/css" href="css/doctum.css">
        <link rel="stylesheet" type="text/css" href="fonts/doctum-font.css">
        <script src="js/jquery-3.5.1.slim.min.js"></script>
        <script async defer src="doctum.js"></script>
        <script async defer src="js/bootstrap.min.js"></script>
        <script async defer src="js/autocomplete.min.js"></script>
        <meta name="MobileOptimized" content="width">
        <meta name="HandheldFriendly" content="true">
        <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
    <link rel="stylesheet" type="text/css" href="css/highlight-github.min.css">
    <script defer src="js/highlight.min.js"></script>
    <script>
        window.addEventListener('load', function () {
            if (!window.hljs) {
                return;
            }

            function ensureCustomClassesAreBuiltIn() {
                var classesToAdd = ['Redis', 'RedisCluster', 'RedisArray'];

                if (!hljs.getLanguage) {
                    return;
                }

                var phpLanguage = hljs.getLanguage('php');
                if (!phpLanguage || !phpLanguage.keywords) {
                    return;
                }

                var builtIns = phpLanguage.keywords.built_in;
                if (!builtIns) {
                    phpLanguage.keywords.built_in = classesToAdd.join(' ');
                    return;
                }

                if (Array.isArray(builtIns)) {
                    classesToAdd.forEach(function (className) {
                        if (builtIns.indexOf(className) === -1) {
                            builtIns.push(className);
                        }
                    });
                    return;
                }

                if (typeof builtIns === 'string') {
                    classesToAdd.forEach(function (className) {
                        if (builtIns.indexOf(className) === -1) {
                            builtIns += ' ' + className;
                        }
                    });
                    phpLanguage.keywords.built_in = builtIns;
                }
            }

            function collectLinkMetadata(container, typeText) {
                var anchors = container.querySelectorAll('a');
                var lastIndex = 0;
                var meta = [];

                for (var i = 0; i < anchors.length; i++) {
                    var anchor = anchors[i];
                    var text = anchor.textContent.trim();
                    if (!text) {
                        continue;
                    }

                    var href = anchor.getAttribute('href');
                    var start = typeText.indexOf(text, lastIndex);

                    if (start === -1) {
                        start = typeText.indexOf(text);
                        if (start === -1) {
                            continue;
                        }
                    }

                    meta.push({
                        start: start,
                        end: start + text.length,
                        href: href
                    });

                    lastIndex = start + text.length;
                }

                return meta;
            }

            function findTextPosition(container, targetIndex) {
                var walker = document.createTreeWalker(
                    container,
                    NodeFilter.SHOW_TEXT,
                    null
                );

                var currentIndex = 0;
                var currentNode;

                while ((currentNode = walker.nextNode())) {
                    var nextIndex = currentIndex + currentNode.textContent.length;

                    if (targetIndex <= nextIndex) {
                        return {
                            node: currentNode,
                            offset: targetIndex - currentIndex
                        };
                    }

                    currentIndex = nextIndex;
                }

                return null;
            }

            function restoreLinks(codeElement, meta) {
                var sorted = meta.slice().sort(function (a, b) {
                    return b.start - a.start;
                });

                for (var i = 0; i < sorted.length; i++) {
                    var info = sorted[i];
                    var startPos = findTextPosition(codeElement, info.start);
                    var endPos = findTextPosition(codeElement, info.end);

                    if (!startPos || !endPos) {
                        continue;
                    }

                    var range = document.createRange();
                    range.setStart(startPos.node, startPos.offset);
                    range.setEnd(endPos.node, endPos.offset);

                    var anchor = document.createElement('a');
                    anchor.setAttribute('href', info.href);
                    anchor.appendChild(range.extractContents());
                    range.insertNode(anchor);
                    range.detach();
                }
            }

            function highlightAndRestore(codeElement, metadata) {
                hljs.highlightElement(codeElement);

                if (metadata && metadata.length) {
                    restoreLinks(codeElement, metadata);
                }
            }

            ensureCustomClassesAreBuiltIn();

            var exampleBlocks = document.querySelectorAll('pre.examples');
            exampleBlocks.forEach(function (block) {
                if (!block.dataset.language) {
                    block.dataset.language = 'php';
                }
                block.classList.add('language-php');
                hljs.highlightElement(block);
            });

            var signatureBlocks = document.querySelectorAll('code.method-signature');
            signatureBlocks.forEach(function (block) {
                if (!block.classList.contains('language-php')) {
                    block.classList.add('language-php');
                }
                hljs.highlightElement(block);
            });

            var phpCodeBlocks = document.querySelectorAll('pre code.language-php');
            phpCodeBlocks.forEach(function (block) {
                if (block.classList.contains('method-signature')) {
                    return;
                }

                if (block.closest('pre.examples')) {
                    return;
                }

                if (block.parentElement && !block.parentElement.classList.contains('language-php')) {
                    block.parentElement.classList.add('language-php');
                }

                hljs.highlightElement(block);
            });

            highlightReturnTypes();
            highlightMethodParameters();
            highlightApiIndex();

            function highlightReturnTypes() {
                if (!document.createTreeWalker || !window.NodeFilter) {
                    return;
                }

                var containers = document.querySelectorAll('.return-value-content');
                containers.forEach(function (container) {
                    var table = container.querySelector('table');
                    if (!table) {
                        return;
                    }

                    table.querySelectorAll('tr').forEach(function (row) {
                        var typeCell = row.querySelector('td');
                        if (!typeCell || typeCell.querySelector('code.return-type')) {
                            return;
                        }

                        var typeText = typeCell.textContent.trim();
                        if (!typeText) {
                            return;
                        }

                        var linkMeta = collectLinkMetadata(typeCell, typeText);
                        var code = document.createElement('code');
                        code.className = 'return-type language-php';
                        code.textContent = typeText;

                        typeCell.innerHTML = '';
                        typeCell.appendChild(code);

                        highlightAndRestore(code, linkMeta);
                    });
                });
            }

            function highlightMethodParameters() {
                if (!document.createTreeWalker || !window.NodeFilter) {
                    return;
                }

                var headings = document.querySelectorAll('.tags > h4');
                headings.forEach(function (heading) {
                    if (!heading.textContent || heading.textContent.trim() !== 'Parameters') {
                        return;
                    }

                    var table = heading.nextElementSibling;
                    while (table && table.tagName !== 'TABLE') {
                        table = table.nextElementSibling;
                    }

                    if (!table) {
                        return;
                    }

                    table.querySelectorAll('tr').forEach(function (row) {
                        var cells = row.querySelectorAll('td');
                        if (!cells.length) {
                            return;
                        }

                        enhanceParameterCell(cells[0], 'parameter-type');

                        if (cells.length > 1) {
                            enhanceParameterCell(cells[1], 'parameter-name');
                        }
                    });
                });

                function enhanceParameterCell(cell, className) {
                    if (!cell || cell.querySelector('code.' + className)) {
                        return;
                    }

                    var cellText = cell.textContent.trim();
                    if (!cellText) {
                        return;
                    }

                    var meta = collectLinkMetadata(cell, cellText);
                    var code = document.createElement('code');
                    code.className = className + ' language-php';
                    code.textContent = cellText;

                    cell.innerHTML = '';
                    cell.appendChild(code);

                    highlightAndRestore(code, meta);
                }
            }

            function highlightApiIndex() {
                if (!document.createTreeWalker || !window.NodeFilter) {
                    return;
                }

                var potentialContainers = document.querySelectorAll('.container-fluid.underlined');
                var containers = [];
                var anchorSelector = '.row .col-md-8 > a[href^="#method_"]';

                for (var i = 0; i < potentialContainers.length; i++) {
                    var candidate = potentialContainers[i];
                    if (!candidate.querySelector(anchorSelector)) {
                        continue;
                    }

                    var heading = candidate.previousElementSibling;
                    if (heading && heading.tagName === 'H2' && heading.textContent && heading.textContent.trim() === 'Methods') {
                        containers.push(candidate);
                    }
                }

                if (!containers.length) {
                    return;
                }

                for (var j = 0; j < containers.length; j++) {
                    var container = containers[j];
                    var rows = container.querySelectorAll('.row');

                    for (var k = 0; k < rows.length; k++) {
                        var row = rows[k];
                        enhanceTypeCell(row.querySelector('.col-md-2.type'));
                        enhanceSignatureCell(row.querySelector('.col-md-8'));
                    }
                }

                function enhanceTypeCell(typeCell) {
                    if (!typeCell || typeCell.querySelector('code.method-index-type')) {
                        return;
                    }

                    var typeText = typeCell.textContent.trim();
                    if (!typeText) {
                        return;
                    }

                    var meta = collectLinkMetadata(typeCell, typeText);

                    var code = document.createElement('code');
                    code.className = 'method-index-type language-php';
                    code.textContent = typeText;

                    typeCell.innerHTML = '';
                    typeCell.appendChild(code);

                    highlightAndRestore(code, meta);
                }

                function enhanceSignatureCell(signatureCell) {
                    if (!signatureCell || signatureCell.querySelector('code.method-index-signature')) {
                        return;
                    }

                    var descriptionStart = null;
                    for (var i = 0; i < signatureCell.children.length; i++) {
                        var child = signatureCell.children[i];
                        if (child.tagName === 'P') {
                            descriptionStart = child;
                            break;
                        }
                    }

                    var nodesToProcess = [];
                    var current = signatureCell.firstChild;
                    while (current && current !== descriptionStart) {
                        nodesToProcess.push(current);
                        current = current.nextSibling;
                    }

                    if (!nodesToProcess.length) {
                        return;
                    }

                    var signatureText = '';
                    for (var j = 0; j < nodesToProcess.length; j++) {
                        signatureText += nodesToProcess[j].textContent || '';
                    }
                    signatureText = signatureText.replace(/\s+/g, ' ').trim();

                    if (!signatureText) {
                        return;
                    }

                    var tempWrapper = document.createElement('div');
                    for (var k = 0; k < nodesToProcess.length; k++) {
                        tempWrapper.appendChild(nodesToProcess[k].cloneNode(true));
                    }

                    var meta = collectLinkMetadata(tempWrapper, signatureText);

                    for (var l = 0; l < nodesToProcess.length; l++) {
                        if (nodesToProcess[l].parentNode === signatureCell) {
                            signatureCell.removeChild(nodesToProcess[l]);
                        }
                    }

                    var code = document.createElement('code');
                    code.className = 'method-index-signature language-php';
                    code.textContent = signatureText;

                    signatureCell.insertBefore(code, descriptionStart);

                    highlightAndRestore(code, meta);
                }
            }
        });
    </script>


        <link rel="search"
          type="application/opensearchdescription+xml"
          href="https://phpredis.github.io/opensearch.xml"
          title="PhpRedis API (develop)" />
    </head>

    <body id="search-page" data-name="" data-root-path="" data-search-index-url="doctum-search.json">
            <div id="content">
        <div id="left-column">
                <div id="control-panel">
                <div class="search-bar hidden" id="search-progress-bar-container">
            <div class="progress">
                <div class="progress-bar" role="progressbar" id="search-progress-bar"
                    aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%"></div>
            </div>
        </div>
        <form id="search-form" action="search.html">
            <span class="icon icon-search"></span>
            <input name="search"
                   id="doctum-search-auto-complete"
                   class="typeahead form-control"
                   type="search"
                   placeholder="Search"
                   spellcheck="false"
                   autocorrect="off"
                   autocomplete="off"
                   autocapitalize="off">
            <div class="auto-complete-results" id="auto-complete-results"></div>
        </form>
    </div>

                <div id="api-tree"></div>

        </div>
        <div id="right-column">
                <nav id="site-nav" class="navbar navbar-default" role="navigation">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-elements">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="index.html">PhpRedis API</a>
            </div>
            <div class="collapse navbar-collapse" id="navbar-elements">
                <ul class="nav navbar-nav">
                    <li><a href="classes.html">Classes</a></li>
                    <li><a href="interfaces.html">Interfaces</a></li>
                    <li><a href="traits.html">Traits</a></li>
                    <li><a href="doc-index.html">Index</a></li>
                    <li><a href="search.html">Search</a></li>
                </ul>
            </div>
        </div>
    </nav>

                        <div id="page-content">
    <div class="page-header">
        <h1>Search</h1>
    </div>

    <p>This page allows you to search through the API documentation for
    specific terms. Enter your search words into the box below and click
    "submit". The search will be performed on namespaces, classes, interfaces,
    traits, functions, and methods.</p>

    <form class="form-inline" role="form" action="search.html">
        <div class="form-group">
            <label class="sr-only" for="search">Search</label>
            <input type="search" class="form-control" name="search" id="search" placeholder="Search" spellcheck="false" autocorrect="off" autocomplete="off" autocapitalize="off">
        </div>
        <button type="submit" class="btn btn-default">submit</button>
    </form>

    <h2 id="search-results-header">Search Results</h2>
    <div class="search-bar hidden" id="search-page-progress-bar-container">
        <div class="progress">
            <div class="progress-bar" role="progressbar" id="search-page-progress-bar"
                aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%"></div>
        </div>
    </div>
    <div class="container-fluid" id="search-results-container">
    </div>

        <script type="text/javascript">
        var DoctumSearch = {
            /** @var boolean */
            pageFullyLoaded: false,
            /** @var string|null */
            searchTerm: null,
            /** @var autoComplete|null */
            autoCompleteJS: null,
            /** @var HTMLElement|null */
            doctumSearchPageAutoCompleteProgressBarContainer: null,
            /** @var HTMLElement|null */
            doctumSearchPageAutoCompleteProgressBar: null,
            searchTypeClasses: {
                'Namespace': 'label-default',
                'Class': 'label-info',
                'Trait': 'label-success',
                'Interface': 'label-primary',
                'Method': 'label-danger',
                'Function': 'label-danger',
                '_': 'label-warning'
            },
            longTypes: {
                'N': 'Namespace',
                'C': 'Class',
                'T': 'Trait',
                'I': 'Interface',
                'M': 'Method',
                'F': 'Function',
                '_': 'label-warning'
            },
            /**
             * Cleans the provided term. If no term is provided, then one is
             * grabbed from the query string "search" parameter.
             */
            cleanSearchTerm: function(term) {
                // Grab from the query string
                if (typeof term === 'undefined') {
                    var name = 'search';
                    var regex = new RegExp("[\\?&]" + name + "=([^&#]*)");
                    var results = regex.exec(location.search);
                    if (results === null) {
                        return null;
                    }
                    term = decodeURIComponent(results[1].replace(/\+/g, " "));
                }

                return term.replace(/<(?:.|\n)*?>/gm, '');
            },
            /**
             * Get a search class for a specific type
             */
            getSearchClass: function(type) {
                return DoctumSearch.searchTypeClasses[type] || DoctumSearch.searchTypeClasses['_'];
            },
            /**
             * Get the long type name
             */
            getLongType: function(type) {
                return DoctumSearch.longTypes[type] || DoctumSearch.longTypes['_'];
            },
            pageFullyLoaded: function (event) {// Will get fired by the main doctum.js script
                DoctumSearch.searchTerm = DoctumSearch.cleanSearchTerm();
                DoctumSearch.searchTermForEngine = Doctum.cleanSearchQuery(DoctumSearch.searchTerm);
                DoctumSearch.doctumSearchPageAutoCompleteProgressBarContainer = document.getElementById('search-page-progress-bar-container');
                DoctumSearch.doctumSearchPageAutoCompleteProgressBar = document.getElementById('search-page-progress-bar');
                DoctumSearch.pageFullyLoaded = true;
                DoctumSearch.launchSearch();
            },
            showNoResults: function() {
                document.getElementById('search-results-container').innerText = 'No\u0020results\u0020were\u0020found';
            },
            launchSearch: function (event) {
                if (
                    DoctumSearch.searchTermForEngine === null
                    || (typeof DoctumSearch.searchTermForEngine === 'string' && DoctumSearch.searchTermForEngine.length === 0)
                    || typeof DoctumSearch.searchTermForEngine !== 'string'
                ) {
                    document.getElementById('search-results-header').className = 'hidden';
                    // Stop the process here
                    return;
                }
                // Set back backslashes to non escaped backslashes
                document.getElementById('search').value = DoctumSearch.searchTermForEngine.replace(/\\\\/g, '\\');

                // Check if the lib is loaded
                if (typeof autoComplete === 'function') {
                    DoctumSearch.bootAutoComplete();
                }
            },
            bootAutoComplete: function () {
                DoctumSearch.autoCompleteJS = new autoComplete(
                    {
                        selector: '#search',
                        searchEngine: function (query, record) {
                            return Doctum.searchEngine(query, record);
                        },
                        submit: true,
                        data: {
                            src: function (q) {
                                return Doctum.loadAutoCompleteData(q);
                            },
                            keys: ['n'],// Data 'Object' key to be searched
                            cache: false, // Is not compatible with async fetch of data
                        },
                        query: (input) => {
                            return Doctum.cleanSearchQuery(input);
                        },
                        trigger: (query) => {
                            return Doctum.cleanSearchQuery(query).length > 0;
                        },
                        resultsList: {
                            tag: 'ul',
                            class: 'search-results',
                            destination: '#search-results-container',
                            position: 'afterbegin',
                            maxResults: 500,
                            noResults: false,
                        },
                        resultItem: {
                            tag: 'li',
                            class: 'search-results-result',
                            highlight: 'search-results-highlight',
                            selected: 'search-results-selected',
                            element: function (item, data) {
                                item.innerHTML = '';// Clean up the content
                                var elementH2 = document.createElement('h2');
                                elementH2.className = 'clearfix';

                                var elementLink = document.createElement('a');
                                elementLink.innerText = data.value.n;
                                elementLink.href = data.value.p;
                                elementH2.appendChild(elementLink);

                                var longType = DoctumSearch.getLongType(data.value.t);
                                var className = DoctumSearch.getSearchClass(longType);

                                var divElement = document.createElement('div');
                                divElement.className = 'search-type type-' + longType;
                                var divSpanElement = document.createElement('span');
                                divSpanElement.className = 'pull-right label ' + className;
                                divSpanElement.innerText = longType;
                                divElement.appendChild(divSpanElement);
                                elementH2.appendChild(divElement);

                                item.appendChild(elementH2);

                                if (typeof data.value.f === 'object') {
                                    var fromElement = document.createElement('div');
                                    fromElement.className = 'search-from';
                                    fromElement.innerText = 'from\u0020';
                                    var fromElementLink = document.createElement('a');
                                    fromElementLink.href = data.value.f.p;
                                    fromElementLink.innerText = data.value.f.n;
                                    fromElement.appendChild(fromElementLink);
                                    item.appendChild(fromElement);
                                }

                                var divSearchDescription = document.createElement('div');
                                divSearchDescription.className = 'search-description';
                                if (data.value.t === 'N') {// Is a namespace
                                    data.value.d = 'Namespace\u0020\u0025s'.replace('%s', data.value.n);
                                }
                                if (typeof data.value.d === 'string') {
                                    var paragraphElement = document.createElement('p');
                                    paragraphElement.innerHTML = data.value.d;
                                    divSearchDescription.appendChild(paragraphElement);
                                }
                                item.appendChild(divSearchDescription);
                            },
                        },
                    }
                );
                Doctum.markInProgress();
                DoctumSearch.autoCompleteJS.start(DoctumSearch.searchTerm);
                DoctumSearch.autoCompleteJS.unInit();// Stop the work, wait for the user to hit submit
                document.getElementById('search').addEventListener('results', function (event) {
                    Doctum.markProgressFinished();
                    if (event.detail.results.length === 0) {
                        DoctumSearch.showNoResults();
                    }
                });
            }
        };
    </script>


</div><div id="footer">
        Generated by <a href="https://github.com/code-lts/doctum">Doctum, a API Documentation generator and fork of Sami</a>.</div></div>
    </div>
    </body>

</html>
